package com.ls.mysql.dao;

import com.ls.mysql.entity.YzStatus;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 身份方法接口
 */
@Mapper
@Component
public interface StatusDao {
    //添加权限类型
    public int AddStatus(@Param("yzStatus") YzStatus yzStatus);
    //更改权限类型
    public int UpdateStatus(@Param("yzStatus") YzStatus yzStatus);
    //遍历权限表
    public List<YzStatus> QueryAllStatus();
    //查询权限类型
    @Select("select * from yz_status a where a.id=#{id}")
    @Results(id="query1",value={
            @Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true),
            @Result(column = "status", property = "status", jdbcType = JdbcType.VARCHAR),
            @Result(column = "PowerLevel", property = "powerLevel", jdbcType = JdbcType.VARCHAR)
    })
    public YzStatus queryStatusById(Integer id);
}
